﻿using System;
using System.Collections;
using System.Data;
using CE.Database;

/// <summary>
/// Summary description for TATravellersToInsureDB
/// </summary>
/// 
namespace CE.TravelInsurance
{
    public class TATravellersToInsureDB
    {
        public TATravellersToInsureDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(TATravellersToInsure tatravellerstoinsure)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocTAtravellersToInsureInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();
            #region Parameter
            _sPara.Add("@TATraId", tatravellerstoinsure.TATraId);
            _sPara.Add("@TAPersonnelId", tatravellerstoinsure.TAPersonnelId);
            _sPara.Add("@ProviderCompanyId", tatravellerstoinsure.ProviderCompanyId);
            _sPara.Add("@Salutation", tatravellerstoinsure.Salutation);
            _sPara.Add("@Fullname", tatravellerstoinsure.Fullname);
            _sPara.Add("@Identificationtype", tatravellerstoinsure.IDType);
            _sPara.Add("@Identificationnum", tatravellerstoinsure.IDNumber);
            _sPara.Add("@Gender", tatravellerstoinsure.Gender);
            _sPara.Add("@Birthday", tatravellerstoinsure.Birthday);
            _sPara.Add("@Nationality", tatravellerstoinsure.Nationality);
            _sPara.Add("@Relationship", tatravellerstoinsure.Relationship);
            _sPara.Add("@Occupation", tatravellerstoinsure.Occupation);
            _sPara.Add("@Status", tatravellerstoinsure.Status);
            _sPara.Add("@RefCEUserId", tatravellerstoinsure.RefCEUserId);
            _sPara.Add("@ViewedDetailId", tatravellerstoinsure.ViewedDetailId);
            _sPara.Add("@Info1", tatravellerstoinsure.Info1);

            #endregion
            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }
    }
}
